package org.karelun.gef.parts;
import org.eclipse.draw2d.BendpointConnectionRouter;
import org.eclipse.draw2d.ColorConstants;
import org.eclipse.draw2d.IFigure;
import org.eclipse.draw2d.PolygonDecoration;
import org.eclipse.draw2d.PolylineConnection;
import org.eclipse.draw2d.geometry.PointList;

public class GeueralizationConnectionEditPart extends CustomAbstractConnectionEditPart{

	protected IFigure createFigure(){
		PolylineConnection conn = new PolylineConnection();
//		PolylineConnection conn = (PolylineConnection) super.createFigure();
		conn.setConnectionRouter(new BendpointConnectionRouter());
	
		PolygonDecoration decoration = new PolygonDecoration();
		
		PointList decorationPointList = new PointList();
		decorationPointList.addPoint(0, 0);   
		decorationPointList.addPoint(-1, 3);
		decorationPointList.addPoint(-1, -3);
	    decorationPointList.addPoint(0, 0);
		
		decoration.setTemplate(decorationPointList);
		decoration.setBackgroundColor(ColorConstants.white);	
			
		conn.setTargetDecoration(decoration);		
		conn.setLineWidth(2);
		return conn;						
	}
	
}
